<?php

use Biz\Constants\Pay\PayEaseConstants;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * NotifyPayEase.
 *
 * @license [http://www.85do.com] [杭州永奥网络科技有限公司]
 * @copyright Copyright (c) 2018-2026 Hangzhou Yongao Technology Co., Ltd. All rights reserved.
 */
class NotifyPayEase extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('notify_pay_ease', function (Blueprint $table) {
            $table->bigIncrements('id');//BigID unsigned
            $table->bigInteger('notify_id')->unsigned();// 通知ID
            $table->string('method', 32)->default(PayEaseConstants::METHOD_SYNC);// 方法，异步、同步
            $table->string('v_oid', 128);// 订单编号
            $table->string('v_pmode', 128);// 支付方式中文说明，如银联支付
            $table->string('v_pstatus',16);// 支付状态码 1已经提交，20，支付成功，30支付失败
            $table->string('v_pstring',64);// 支付结果信息
            $table->string('v_md5info',128);// 数字签名
            $table->decimal('v_amount',19,4);// 订单实际支付金额
            $table->integer('v_moneytype');// 订单实际支付币种 0 人民币，1 美元
            $table->string('v_md5money',128);// 数字签名
            $table->text('v_mac')->default('');// 数字指纹
            $table->text('v_sign')->default('');// 商城数据签名

            // 注意时间戳位数
            $table->timestamps();
            $table->softDeletes();

            // index
            //$table->unique('order_no');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('notify_pay_ease');
    }
}